package com.rtx.wms.std.so.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.rtx.wms.std.handler.cancle.WmsCancelHandler;
import com.rtx.wms.std.handler.check.OrderCheckHandler;
import com.rtx.wms.std.handler.so.down.GrpSoCreateHandle;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wq
 * @since 2023-04-14
 */
@Api(tags = {"出库单"})
@RestController
@RequestMapping("/v1/wms/so")
@CrossOrigin
public class ApiOrdersController {

    @Autowired
    private WmsCancelHandler wmsCancelHandler;
    
    @Autowired
    private GrpSoCreateHandle soCreateHandle;
    
    @Autowired
    OrderCheckHandler orderCheckHandler;
    

    
    @ApiOperation(value = "出库订单创建")
    @PostMapping("/create/std")
    public String soCreate(HttpServletRequest request){
        return soCreateHandle.create(request);
    }
    
    @ApiOperation(value = "单据编辑前校对")
    @PostMapping("/check/std")
    public String checkorder(HttpServletRequest request){
    	return orderCheckHandler.checkOrder(request);
    }

    @ApiOperation(value = "取消订单")
    @PostMapping("/cancel/std")
    public String cancelOrders(HttpServletRequest request){
        return wmsCancelHandler.ordersCancel(request);
    }
}
